package com.ecube.protocol.box;

import com.ecube.protocol.common.ProtocolFunction;
import com.ecube.protocol.enums.BoxFunctionEnum;
import lombok.Data;

/**
 * 箱变设备报文
 * 9.1.高压断路器状态
 *
 * @author zhuweijun
 * @version 1.0.0
 * @since 2025/7/31 13:54
 */
@Data
@ProtocolFunction(type = BoxFunctionEnum.class, value = "VAB_STATE")
public class BoxVcbState {

    private String swapId; // 换电站/充电站编号
    private String vcbld = "10-1-01"; // 高压断路器编号
    private Integer vcbStatus = 1; // 合分闸状态
    private String vcbFaultCode = "01"; // 高压断路器故障码
    private String vcbTripReason; // 高压断路器跳闸原因
    private Float voltageA = 256.0F; // AB线电压
    private Float voltageB = 256.0F; // BC线电压
    private Float voltageC; // CA线电压
    private Float currentA; // A相电流
    private Float currentB; // B相电流
    private Float currentC; // C相电流
    private Float activePower; // 有功功率
    private Float reactivePower; // 无功功率
    private Float powerFactor; // 功率因数
    private Float frequency; // 频率
    private Float electricity; // 正向有功电量
    private Float vcbAmbientTemperature; // 高压室环境温度
    private Float vcbAmbientHumidity; // 高压室环境湿度
    private Integer vcbDisconnectorState; // 高压隔离开关位置（0-分闸, 1-合闸）
    private Integer groundingSwitchState; // 接地开关位置（0-分闸, 1-合闸）
    private Integer transformerDoorState; // 变压器网门开关状态（0-开门, 1-关门）
    private Float reactiveElectricity; // 正向无功电量
    private Integer stationType; // 站的类型（1-换电站, 2-充电站）
    private Float reverseElectricity; // 反向有功电量
    private Float reverseReactiveElectricity; // 反向无功电量

    public static BoxVcbState init() {
        BoxVcbState vcbState = new BoxVcbState();
        vcbState.setSwapId(null);
        vcbState.setVcbld("10-1-01");
        vcbState.setVcbStatus(1); // 合闸状态
        vcbState.setVcbFaultCode("100101");
        vcbState.setVcbTripReason(null);
        vcbState.setVoltageA(220.5F);
        vcbState.setVoltageB(220.7F);
        vcbState.setVoltageC(220.6F);
        vcbState.setCurrentA(10.2F);
        vcbState.setCurrentB(10.3F);
        vcbState.setCurrentC(10.4F);
        vcbState.setActivePower(50.0F);
        vcbState.setReactivePower(25.0F);
        vcbState.setPowerFactor(0.9F);
        vcbState.setFrequency(50.0F);
        vcbState.setElectricity(100.0F);
        vcbState.setVcbAmbientTemperature(25.0F);
        vcbState.setVcbAmbientHumidity(50.0F);
        vcbState.setVcbDisconnectorState(1); // 合闸状态
        vcbState.setGroundingSwitchState(1); // 合闸状态
        vcbState.setTransformerDoorState(1); // 关门状态
        vcbState.setReactiveElectricity(50.0F);
        vcbState.setStationType(1); // 换电站
        vcbState.setReverseElectricity(10.0F);
        vcbState.setReverseReactiveElectricity(5.0F);
        return vcbState;
    }
}
